// 1引入Vue
import Vue from "vue";
// 2引入Vuex
import Vuex from "vuex";
// 让Vue使用vuex插件
Vue.use(Vuex);
// 创建一个state对象
const state = {
  count: 1,
  price: 919,
};

const mutations = {
  increment(state) {
    state.count++;
  },

  incrementN(state, { n }) {
    state.count += n;
  },
  decrement(state) {
    state.count--;
  },
};
export default new Vuex.Store({
  state,
  mutations,
});
